use "${datadir_epc}\epc-cer", replace

keep if transaction_type == "new dwelling"
drop if mi(total_floor_area)

duplicates drop lmk_key, force
drop extension_count

gen postcode_tomatch = strtrim(postcode)
replace postcode_tomatch = regexr(postcode, " ", "")

save "${datadir}\epc-cer_new", replace